package com.matrix.java.chap_18;

public class Ex18_13 {
    public static void main(String[] args) {
        System.out.println(findMax(new int[]{1, 2, 3, 4, 5, 6, 11, 1}));
    }
    public static int findMax(int[] list) {
        return findMax(list, list.length - 1);
    }

    public static int findMax(int[] list, int length) {
        if (length==0){
            return list[0];
        }else {
            return Math.max(findMax(list,length-1),list[length]);
        }
    }
}
